home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
011
/
attclk2.arc
/
TIMEDISP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1986-01-09
|
745b
|
35 lines
/* :ts=8
*
* timedisp()
*
* Displays supplied string with date/time found in buf
* structure. Displays as follows:
*
* timedisp("Sample string");
*
* Sample string Tue 7-Jan-86 22:12:53.11
*
*/
#include "setdate.h"
extern struct tm buf;
/* table of day strings */
char days[7][4] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
/* table of month strings */
char months[12][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
timedisp(string)
char *string;
{
printf("%s%s %d-%s-%d %d:%02d:%02d.%02d", string,
days[buf.tm_wday],
buf.tm_mday, months[buf.tm_mon], buf.tm_year + 1900,
buf.tm_hour, buf.tm_min, buf.tm_sec, buf.tm_hsec);
}